package utils

const (
	IPBLKeyPre  = "IPBlackList:"
	IPBLKeyTime = 1800
)

type IPBlackList struct {
	BL *SafeStrMap
}

func MakeNewIPBlackList() *IPBlackList {
	bls := &IPBlackList{MakeNewSafeStrMap()}
	return bls
}

// func (this *IPBlackList) Load() {
// 	key := IPBLKeyPre + "*"
// 	ips := GetRedisKeys(key)
// 	this.BL.Clear()
// 	for _, k := range ips {
// 		this.BL.Set(k, 1)
// 	}
// }

// func (this *IPBlackList) IsBlackList(ip string) bool {
// 	return this.BL.IsExist(IPBLKeyPre + ip)
// }

// func (this *IPBlackList) Set(ip string) {
// 	key := IPBLKeyPre + ip
// 	SetKeyValueOfRedis(key, "1")
// 	RefreshKey(key, IPBLKeyTime)
// }
